home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)abi.d64
/
graph maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
175 lines
1 REM *******************************
2 REM * *
3 REM * GRAPHMAKER 64 (C) 1984 *
4 REM * DOUG SMOAK *
5 REM * 303 HEYWARD ST. *
6 REM * COLUMBIA SC 29203 *
7 REM * (803)-765-1189 *
8 REM * *
9 REM *******************************
10 BO=53280:BG=BO+1:POKEBG,0:POKEBO,0:POKE56296,0
20 OV$=""
30 DN$=""
40 BL$=DN$+""+" "
50 CC=4:DIMFR$(7),T$(36),V(36),CL$(7),F$(2),S(2),E(2)
60 S(1)=1024:E(1)=2024:S(2)=55296:E(2)=56297
70 CL$(0)="[152]":CL$(1)="[158]":CL$(2)="[129]":CL$(3)="":CL$(4)="[156]":CL$(5)=""
80 CL$(6)="[154]":CL$(7)="[155]"
90 PRINT"[147][152] GRAPHMAKER 64"
100 PRINT"C_CREATE A GRAPH":PRINT"L_LOAD A GRAPH"
110 GETG$:ON-(G$="")GOTO110:IFG$<>"L"ANDG$<>"C"THEN110
120 IFG$="L"THEN1170
130 INPUT"[147]MAXIMUM VERTICAL SCALE VALUE";MX:BI=MX/20:LI=BI/7:IFMX=<0THEN130
140 GOSUB280:GOSUB570
150 FORI=1TOVB
160 PRINT"[147]VALUE TO BE GRAPHED":PRINT"FOR BAR #"I"[157], "T$(I);
170 INPUTV(I):IFV(I)>MXTHENV(I)=MX
180 GOSUB390
190 NEXT:PRINTGR$MX$
200 :
210 REM ** LOOP FOR BARS **
220 :
230 FORC=1TOVB:V=V(C):V=V-3*(BI/7):GOSUB460:NEXT
240 GOTO810
250 :
260 REM ** SET UP PARAMETERS **
270 :
280 PRINT"[147]HOW MANY VERTICAL BARS":PRINT"(2-36) ";:INPUTVB
290 IFVB>36ORVB<2THEN280
300 BW=INT(36/VB)
310 FORI=1TOVB
320 PRINT"[147]TITLE FOR BAR #"I:PRINT"UP TO"BW"CHARACTERS";
330 INPUTT$(I):IFT$(I)=""THENT$(I)=STR$(I)
340 IFLEN(T$(I))>BWAND(BW>2)THEN320
350 NEXT:RETURN
360 :
370 REM ** CENTER ROUTINE **
380 :
390 IFBW<3THENT$(I)=RIGHT$(T$(I),1):RETURN
400 IFLEN(T$(I))=BWTHENRETURN
410 MR=BW-LEN(T$(I)):MR=MR/2:IFMR<1THENRETURN
420 MR$="":FORJ=1TOMR:C$=""+C$:NEXT:T$(I)=C$+T$(I):C$="":RETURN
430 :
440 REM ** CHART ROUTINE **
450 :
460 IFV<LIANDV(C)>0THENFR=1:GOTO480
470 IFV>0THENBL=INT(V/BI):F=V-BL*BI:FR=INT(F/LI)
480 CC$=LEFT$(OV$,CC)
490 PRINTDN$"[152]"CC$T$(C);
500 PRINT""CL$(CAND7)
510 PRINTDN$CC$;:IFBL=0THEN530
520 FORI=1TOBL:PRINTCL$;:NEXT
530 IFFR>0THENPRINTFR$(FR)
540 CC=CC+BW:BL=0:FR=0:RETURN
550 :
560 REM ** SET UP STRINGS **
570 :
580 MX$=STR$(MX):MX$=RIGHT$(MX$,LEN(MX$)-1)
590 MX$=LEFT$(MX$,3):J=3-LEN(MX$):IFJ=0THEN610
600 FORI=1TOJ:M$=" "+M$:NEXT:MX$=M$+MX$:M$=""
610 HF=100*MX:HF=INT(HF/2):HF=HF/100:HF$=STR$(HF)
620 HF$=RIGHT$(HF$,LEN(HF$)-1):HF$=LEFT$(HF$,3)
630 J=3-LEN(HF$):IFJ=0THEN650
640 FORI=1TOJ:M$=M$+" ":NEXT:HF$=M$+HF$:M$=""
650 IFVAL(HF$)>VAL(MX$)THENHF$=LEFT$(" "+HF$,3)
660 MX$=""+MX$+"[157][157][157]"+HF$
670 GR$="[221][157][171][157]":FORI=1TO4:C$=C$+GR$:NEXT:C$=C$
680 C$="[152][147][171][157]"+C$
690 FORI=1TO5:C$=C$+GR$:NEXT:GR$=C$+"[221][157]":C$=""
700 GR$=GR$+"[157]0[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
710 FORI=1TOBW:C$=C$+" ":NEXT:CL$=C$:C$=""
720 FORI=1TOBW:C$=C$+"[157]":NEXT:CL$=""+CL$+C$+"[145][146]":C$=""
730 FR$="[164][175][185][162][184][183][163]":FORI=1TO7:FR$(I)=MID$(FR$,I,1)
740 IFI>4THENFR$(I)=""+FR$(I)+"[146]"
750 NEXT
760 FORI=1TO7:FORJ=1TOBW:F$=F$+FR$(I):NEXTJ:FR$(I)=F$:F$="":NEXTI
770 RETURN
780 :
790 REM **INPUT FOR S/L, TITLE, ETC.**
800 :
810 PRINTDN$"[152]<T>EXT <S>AVE <A>BORT <L>OAD <P>RINT":FORT=1TO800:NEXT
820 GETG$:IFG$<>""THENPRINTBL$:GOTO840
830 PRINTBL$:FORT=1TO125:NEXT:GOTO810
840 IFG$="A"THENRUN
850 IFG$="L"THEN1170
860 IFG$="T"THEN1250
870 IFG$="P"THEN1460
880 IFG$<>"S"THEN810
890 :
900 REM ** GET SAVE FILENAME **
910 :
920 F$="":PRINTDN$"FILENAME?[166][157]";
930 GETG$:ON-(G$="")GOTO930
940 IFASC(G$)>31ANDASC(G$)<96THENF$=F$+G$
950 IFG$<>CHR$(13)THENPRINT" [157]"G$"[166][157]";:GOTO930
960 PRINTBL$:IFF$=""THEN810
970 IFLEN(F$)>14THEN920
980 F$(1)=F$:F$(2)=F$+".C"
990 OP$="S":FORJ=1TO2:F$=F$(J)
1000 S=S(J):E=E(J)
1010 GOSUB1050:NEXT:GOSUB1600:GOTO810
1020 :
1030 REM ** SAVE AND LOAD **
1040 :
1050 FORI=1TOLEN(F$):POKE819+I,ASC(MID$(F$,I,1)):NEXT
1060 POKE183,LEN(F$):POKE187,52:POKE188,3:POKE186,8:POKE185,1
1070 IFOP$="L"THEN1210
1080 :
1090 REM ** SAVE **
1100 :
1110 SH=INT(S/256):SL=S-SH*256:EH=INT(E/256):EL=E-EH*256
1120 POKE251,SL:POKE252,SH:POKE780,251:POKE781,EL:POKE782,EH
1130 SYS65496:RETURN
1140 :
1150 REM ** LOAD **
1160 :
1170 INPUT"[147]EXACT FILENAME";F$:IFF$=""ORLEN(F$)>14THEN1170
1180 F$(1)=F$:F$(2)=F$+".C"
1190 FORJ=1TO2:F$=F$(J):OP$="L":GOSUB1050
1200 NEXT:GOSUB1600:GOTO810
1210 POKE780,0:SYS65493:RETURN
1220 :
1230 REM ** CURSOR ROUTINE **
1240 :
1250 SC=1024:CR=55296
1260 IFIN<0THENIN=0
1270 IFIN>959THENIN=959
1280 OM=PEEK(SC+IN):OC=PEEK(CR-IN)
1290 POKESC+IN,(PEEK(SC+IN)+128)AND255:POKECR+IN,PEEK(646)
1300 GETG$:ON-(G$="")GOTO1290
1310 IFG$="\"THENGOSUB1410:GOTO810
1320 IFG$="[148]"ORG$=""THENG$="[221]"
1330 IFG$=CHR$(13)THENOM=(OM+128)AND255:GOSUB1410:IN=IN+1:GOTO1260
1340 IFG$=""THENGOSUB1410:IN=(IN+1):GOTO1260
1350 IFG$="[157]"THENGOSUB1410:IN=(IN-1):GOTO1260
1360 IFG$="[145]"THENGOSUB1410:IN=(IN-40):GOTO1260
1370 IFG$=""THENGOSUB1410:IN=(IN+40):GOTO1260
1380 SP=IN:GOSUB1420:PRINTG$
1390 IFASC(G$)>31ANDASC(G$)<128THENIN=IN+1
1400 GOTO1260
1410 POKESC+IN,OM:POKECR+IN,OC:RETURN
1420 Y=INT(SP/40):X=SP-40*Y:POKE781,Y:POKE782,X:SYS65520:RETURN
1430 :
1440 REM ** PRINTER DUMP **
1450 :
1460 R$=CHR$(145):V$=CHR$(146):OPEN4,4:CMD4:G=PEEK(648)*256
1470 PRINTR$+CHR$(14)
1480 FORP=GTOG+999
1490 C=PEEK(P):C$=""
1500 IF(P-G)/40=INT((P-G)/40)THENPRINTCHR$(8)+CHR$(13)+CHR$(14);
1510 IFC>128THENC=C-128:C$=CHR$(18)
1520 IFC<32ORC>95THENC=C+64:GOTO1540
1530 IFC>63ANDC<96THENC=C+128
1540 C$=C$+CHR$(C):IFLEN(C$)>1THENC$=C$+V$+R$
1550 PRINTC$;:NEXT:PRINT#4:CLOSE4
1560 GOTO810
1570 :
1580 REM ** READ DISK ERROR CH **
1590 :
1600 OPEN15,8,15:INPUT#15,A,B$,C,D
1610 CLOSE15
1620 IFA=0THENRETURN
1630 PRINTBL$DN$""A"[157] "B$" ERROR":FORT=1TO850:NEXT
1640 GETG$:IFG$<>""THENRETURN
1650 PRINTDN$"PRESS ANY KEY TO CONTINUE":FORT=1TO850:NEXT:GOTO1630